import request from '@/utils/request'

export function findSysUserRecord(nextPage,pageSize,LIKE_nickName,LIKE_phone,GTE_createTime,LTE_createTime,EQ_districtId) {
  return request({
    url: '/authcenter/sys-user-profile/findList',
    method: 'get',
    params: {
      LIKE_nickName: LIKE_nickName,
      LIKE_phone: LIKE_phone,
      GTE_createTime: GTE_createTime,
      LTE_createTime: LTE_createTime,
      EQ_districtId: EQ_districtId,
      nextPage: nextPage,
      pageSize: pageSize
    }
  })
}

export function detailSysUserRecord(id) {
  return request({
    url: '/authcenter/sys-user/get',
    method: 'get',
    params: {id: id}
  })
}

export function findSysUserPageRecord(nextPage,pageSize,LIKE_phone,LIKE_nickName,GTE_createTime,LTE_createTime,EQ_districtId) {
  return request({
    url: '/authcenter/sys-user-profile/findPage',
    method: 'get',
    params: {
      nextPage: nextPage,
      pageSize: pageSize,
      LIKE_phone: LIKE_phone,
      LIKE_nickName: LIKE_nickName,
      GTE_createTime: GTE_createTime,
      LTE_createTime: LTE_createTime,
      EQ_districtId: EQ_districtId,
    }
  })
}

export function getOverviewRecord(phone) {
  return request({
    url: '/authcenter/sys-user-profile/getOverview',
    method: 'get',
    params: {phone: phone}
  })
}

export function lockedSysUserRecord(id,locked) {
  return request({
    url: '/authcenter/sys-user-profile/lock',
    method: 'put',
    params: {id: id, locked: locked}
  })
}

export function initPasswordRecord(id) {
  return request({
    url: '/authcenter/sys-user-profile/initPassword',
    method: 'put',
    params: {id: id}
  })
}

export function editSysUserRecord(data) {
  return request({
    url: '/authcenter/sys-user/edit',
    method: 'put',
    data
  })
}

export function getSysUserRecord(id) {
  return request({
    url: '/authcenter/sys-user-profile/get',
    method: 'get',
    params: {id: id}
  })
}

export function findRoleListRecord(id) {
  return request({
    url: '/authcenter/sys-user-profile/findRoleList',
    method: 'get',
    params: {id: id}
  })
}

export function safeLevelSysUserRecord(userId) {
  return request({
    url: '/authcenter/sys-user/safeLevel',
    method: 'get',
    params: {userId: userId}
  })
}

export function weChatBindSysUserRecord(id,operateId,weChatBinding) {
  return request({
    url: '/authcenter/sys-user/weChatBind',
    method: 'put',
    params: {id: id, operateId: operateId, weChatBinding: weChatBinding}
  })
}

export function weChatUnbindSysUserRecord(userId) {
  return request({
    url: '/authcenter/sys-user/weChatUnbind',
    method: 'put',
    params: {userId: userId}
  })
}
